/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.fandi.util;

import javax.swing.JOptionPane;

/**
 *
 * @author Fandy
 */
public class Message {
    public static final String INFO = "info";
    public static final String WARNING = "warning";
    public static final String ERROR = "error";
    
    public static void showMessage(String message, String title, String type) {
        if (type.equals(INFO)) {
            JOptionPane.showMessageDialog(null, message, title, JOptionPane.INFORMATION_MESSAGE);
        } else if (type.equals(WARNING)) {
            JOptionPane.showMessageDialog(null, message, title, JOptionPane.WARNING_MESSAGE);
        } else if (type.equals(ERROR)) {
            JOptionPane.showMessageDialog(null, message, title, JOptionPane.ERROR_MESSAGE);
        } else {
            JOptionPane.showMessageDialog(null, "Message type not found", "Not Found", JOptionPane.ERROR_MESSAGE);
        }
    }
}
